home *** CD-ROM | disk | FTP | other *** search
/ Motor Sport Digital Archive Collection 1960s / Motor Sport Digital Archive Collection 1960s.iso / main.swf / scripts / views / SpreadThumb.as < prev    next >
Encoding:
Text File  |  2008-05-21  |  10.5 KB  |  351 lines

  1. package views
  2. {
  3.    import flash.accessibility.*;
  4.    import flash.debugger.*;
  5.    import flash.display.*;
  6.    import flash.errors.*;
  7.    import flash.events.*;
  8.    import flash.external.*;
  9.    import flash.filters.*;
  10.    import flash.geom.*;
  11.    import flash.media.*;
  12.    import flash.net.*;
  13.    import flash.printing.*;
  14.    import flash.profiler.*;
  15.    import flash.system.*;
  16.    import flash.text.*;
  17.    import flash.ui.*;
  18.    import flash.utils.*;
  19.    import flash.xml.*;
  20.    import mx.binding.*;
  21.    import mx.containers.Canvas;
  22.    import mx.controls.Button;
  23.    import mx.controls.Image;
  24.    import mx.core.UIComponentDescriptor;
  25.    import mx.core.mx_internal;
  26.    import mx.events.FlexEvent;
  27.    import mx.events.PropertyChangeEvent;
  28.    import mx.styles.*;
  29.    
  30.    public class SpreadThumb extends Canvas
  31.    {
  32.       private static var _watcherSetupUtil:IWatcherSetupUtil;
  33.       
  34.       private var _bindings:Array;
  35.       
  36.       public var _bindingsByDestination:Object;
  37.       
  38.       [Bindable]
  39.       private var _1792717999myFilters:Array;
  40.       
  41.       [Bindable]
  42.       private var _686208864spreadThumbImg:Image;
  43.       
  44.       [Bindable]
  45.       private var _3433103page:String;
  46.       
  47.       public var _bindingsBeginWithWord:Object;
  48.       
  49.       [Bindable]
  50.       private var _859611628imageURL:String;
  51.       
  52.       [Bindable]
  53.       private var _686197939spreadThumbTxt:Button;
  54.       
  55.       private var _watchers:Array;
  56.       
  57.       [Bindable]
  58.       private var _187711434oldStyle:String = "spreadThumbNormal";
  59.       
  60.       [Bindable]
  61.       private var _109780401style:String = "spreadThumbNormal";
  62.       
  63.       private var _documentDescriptor_:UIComponentDescriptor;
  64.       
  65.       public function SpreadThumb()
  66.       {
  67.          _documentDescriptor_ = new UIComponentDescriptor({
  68.             "type":Canvas,
  69.             "propertiesFactory":function():Object
  70.             {
  71.                return {"childDescriptors":[new UIComponentDescriptor({
  72.                   "type":Image,
  73.                   "id":"spreadThumbImg",
  74.                   "events":{"init":"__spreadThumbImg_init"},
  75.                   "stylesFactory":function():void
  76.                   {
  77.                      this.horizontalCenter = 0;
  78.                   },
  79.                   "propertiesFactory":function():Object
  80.                   {
  81.                      return {"y":0};
  82.                   }
  83.                }),new UIComponentDescriptor({
  84.                   "type":Button,
  85.                   "id":"spreadThumbTxt",
  86.                   "stylesFactory":function():void
  87.                   {
  88.                      this.horizontalCenter = 0;
  89.                   },
  90.                   "propertiesFactory":function():Object
  91.                   {
  92.                      return {
  93.                         "buttonMode":false,
  94.                         "y":95,
  95.                         "height":20
  96.                      };
  97.                   }
  98.                })]};
  99.             }
  100.          });
  101.          _109780401style = "spreadThumbNormal";
  102.          _187711434oldStyle = "spreadThumbNormal";
  103.          super();
  104.          mx_internal::_document = this;
  105.          if(!this.styleDeclaration)
  106.          {
  107.             this.styleDeclaration = new CSSStyleDeclaration();
  108.          }
  109.          this.styleDeclaration.defaultFactory = function():void
  110.          {
  111.             this.horizontalCenter = 0;
  112.          };
  113.          this.addEventListener("creationComplete",___Canvas1_creationComplete);
  114.       }
  115.       
  116.       public static function set watcherSetupUtil(param1:IWatcherSetupUtil) : void
  117.       {
  118.          SpreadThumb._watcherSetupUtil = param1;
  119.       }
  120.       
  121.       public function set imageURL(param1:String) : void
  122.       {
  123.          var _loc2_:Object = null;
  124.          _loc2_ = this._859611628imageURL;
  125.          if(_loc2_ !== param1)
  126.          {
  127.             this._859611628imageURL = param1;
  128.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"imageURL",_loc2_,param1));
  129.          }
  130.       }
  131.       
  132.       [Bindable(event="propertyChange")]
  133.       private function get myFilters() : Array
  134.       {
  135.          return this._1792717999myFilters;
  136.       }
  137.       
  138.       [Bindable(event="propertyChange")]
  139.       public function get spreadThumbImg() : Image
  140.       {
  141.          return this._686208864spreadThumbImg;
  142.       }
  143.       
  144.       private function init() : void
  145.       {
  146.          var _loc1_:BevelFilter = null;
  147.          var _loc2_:DropShadowFilter = null;
  148.          _loc1_ = new BevelFilter(1,45,0,1,0,1,1,1,1);
  149.          _loc2_ = new DropShadowFilter(2);
  150.          myFilters = [_loc1_,_loc2_];
  151.       }
  152.       
  153.       private function imageInit(param1:Event) : void
  154.       {
  155.          spreadThumbImg.width = spreadThumbImg.contentWidth;
  156.       }
  157.       
  158.       public function set page(param1:String) : void
  159.       {
  160.          var _loc2_:Object = null;
  161.          _loc2_ = this._3433103page;
  162.          if(_loc2_ !== param1)
  163.          {
  164.             this._3433103page = param1;
  165.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"page",_loc2_,param1));
  166.          }
  167.       }
  168.       
  169.       public function set spreadThumbImg(param1:Image) : void
  170.       {
  171.          var _loc2_:Object = null;
  172.          _loc2_ = this._686208864spreadThumbImg;
  173.          if(_loc2_ !== param1)
  174.          {
  175.             this._686208864spreadThumbImg = param1;
  176.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"spreadThumbImg",_loc2_,param1));
  177.          }
  178.       }
  179.       
  180.       public function __spreadThumbImg_init(param1:Event) : void
  181.       {
  182.          imageInit(param1);
  183.       }
  184.       
  185.       private function set myFilters(param1:Array) : void
  186.       {
  187.          var _loc2_:Object = null;
  188.          _loc2_ = this._1792717999myFilters;
  189.          if(_loc2_ !== param1)
  190.          {
  191.             this._1792717999myFilters = param1;
  192.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"myFilters",_loc2_,param1));
  193.          }
  194.       }
  195.       
  196.       [Bindable(event="propertyChange")]
  197.       public function get style() : String
  198.       {
  199.          return this._109780401style;
  200.       }
  201.       
  202.       private function _SpreadThumb_bindingsSetup() : void
  203.       {
  204.          var binding:Binding = null;
  205.          if(!_bindings)
  206.          {
  207.             _bindings = [];
  208.          }
  209.          if(!_watchers)
  210.          {
  211.             _watchers = [];
  212.          }
  213.          binding = new Binding(this,function():Array
  214.          {
  215.             return myFilters;
  216.          },function(param1:Array):void
  217.          {
  218.             spreadThumbImg.filters = param1;
  219.          },"spreadThumbImg.filters");
  220.          _bindings[0] = binding;
  221.          binding = new Binding(this,function():Object
  222.          {
  223.             return "images/thumbs/" + imageURL;
  224.          },function(param1:Object):void
  225.          {
  226.             spreadThumbImg.source = param1;
  227.          },"spreadThumbImg.source");
  228.          _bindings[1] = binding;
  229.          binding = new Binding(this,function():Object
  230.          {
  231.             return style;
  232.          },function(param1:Object):void
  233.          {
  234.             spreadThumbTxt.styleName = param1;
  235.          },"spreadThumbTxt.styleName");
  236.          _bindings[2] = binding;
  237.          binding = new Binding(this,function():Array
  238.          {
  239.             return myFilters;
  240.          },function(param1:Array):void
  241.          {
  242.             spreadThumbTxt.filters = param1;
  243.          },"spreadThumbTxt.filters");
  244.          _bindings[3] = binding;
  245.          binding = new Binding(this,function():String
  246.          {
  247.             var _loc1_:* = undefined;
  248.             var _loc2_:* = undefined;
  249.             _loc1_ = page;
  250.             return _loc1_ == undefined ? null : String(_loc1_);
  251.          },function(param1:String):void
  252.          {
  253.             spreadThumbTxt.label = param1;
  254.          },"spreadThumbTxt.label");
  255.          _bindings[4] = binding;
  256.       }
  257.       
  258.       [Bindable(event="propertyChange")]
  259.       public function get imageURL() : String
  260.       {
  261.          return this._859611628imageURL;
  262.       }
  263.       
  264.       public function ___Canvas1_creationComplete(param1:FlexEvent) : void
  265.       {
  266.          init();
  267.       }
  268.       
  269.       public function set spreadThumbTxt(param1:Button) : void
  270.       {
  271.          var _loc2_:Object = null;
  272.          _loc2_ = this._686197939spreadThumbTxt;
  273.          if(_loc2_ !== param1)
  274.          {
  275.             this._686197939spreadThumbTxt = param1;
  276.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"spreadThumbTxt",_loc2_,param1));
  277.          }
  278.       }
  279.       
  280.       [Bindable(event="propertyChange")]
  281.       public function get page() : String
  282.       {
  283.          return this._3433103page;
  284.       }
  285.       
  286.       public function set style(param1:String) : void
  287.       {
  288.          var _loc2_:Object = null;
  289.          _loc2_ = this._109780401style;
  290.          if(_loc2_ !== param1)
  291.          {
  292.             this._109780401style = param1;
  293.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"style",_loc2_,param1));
  294.          }
  295.       }
  296.       
  297.       [Bindable(event="propertyChange")]
  298.       public function get spreadThumbTxt() : Button
  299.       {
  300.          return this._686197939spreadThumbTxt;
  301.       }
  302.       
  303.       override public function initialize() : void
  304.       {
  305.          var target:SpreadThumb = null;
  306.          var watcherSetupUtilClass:Object = null;
  307.          mx_internal::setDocumentDescriptor(_documentDescriptor_);
  308.          _SpreadThumb_bindingsSetup();
  309.          target = this;
  310.          if(_watcherSetupUtil == null)
  311.          {
  312.             watcherSetupUtilClass = getDefinitionByName("_views_SpreadThumbWatcherSetupUtil");
  313.             watcherSetupUtilClass["init"](null);
  314.          }
  315.          _watcherSetupUtil.setup(this,function(param1:String):*
  316.          {
  317.             return target[param1];
  318.          },_bindings,_watchers);
  319.          super.initialize();
  320.       }
  321.       
  322.       private function _SpreadThumb_bindingExprs() : void
  323.       {
  324.          var _loc1_:* = undefined;
  325.          _loc1_ = myFilters;
  326.          _loc1_ = "images/thumbs/" + imageURL;
  327.          _loc1_ = style;
  328.          _loc1_ = myFilters;
  329.          _loc1_ = page;
  330.       }
  331.       
  332.       [Bindable(event="propertyChange")]
  333.       public function get oldStyle() : String
  334.       {
  335.          return this._187711434oldStyle;
  336.       }
  337.       
  338.       public function set oldStyle(param1:String) : void
  339.       {
  340.          var _loc2_:Object = null;
  341.          _loc2_ = this._187711434oldStyle;
  342.          if(_loc2_ !== param1)
  343.          {
  344.             this._187711434oldStyle = param1;
  345.             dispatchEvent(PropertyChangeEvent.createUpdateEvent(this,"oldStyle",_loc2_,param1));
  346.          }
  347.       }
  348.    }
  349. }
  350.  
  351.